package Day08;

import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println("请输入三角形的行数：");
        int rows = in.nextInt();

        for(int i = 1; i <= rows; i++){ // 外层循环控制的是总行数。
            for(int j = 0; j < rows - i; j++){
                System.out.print(" ");
            }
            for(int k = 0; k < i * 2 - 1; k++){
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
